package org.sardine.beans.support;

import java.util.ArrayList;
import java.util.List;

import org.sardine.util.ClassUtils;

public class ElmBeanDefinition {
	
	private final String id;
	private final Class beanClass;
	private final List<ElmPropertyDefinition> propertyList = new ArrayList<ElmPropertyDefinition>();
	
	public ElmBeanDefinition(String id,String clazz){
		this.id = id;
		try {
			this.beanClass = ClassUtils.forName(clazz);
		} catch (ClassNotFoundException e) {
			throw new BeanObjectInstantiationException("找不到此类："+clazz,e);
		}
	}

	public String getId() {
		return id;
	}

	public Class getBeanClass() {
		return this.beanClass;
	}

	public List<ElmPropertyDefinition> getPropertyList() {
		return propertyList;
	}
	
	public void addProperty(ElmPropertyDefinition property){
		this.propertyList.add(property);
	}
	

}
